<?php

class Contact {
	
	private $id;
	private $type;
	
	function __construct() {
		$this->id;
		$this->type;
	}
	public function getId() {
		return $this->id;
	}

	public function getType() {
		return $this->type;
	}

	public function setId($id) {
		$this->id = $id;
	}

	public function setType($type) {
		$this->type = $type;
	}
	
	public function getAll(){
		$connect = new Connect();
		$connect = $connect->findAll('contacts');
		return $connect;
	}
	
	public function getOne($id){
		$connect = new Connect();
		$connect = $connect->findById('contacts',$id);
		return $connect;
	}
	
	public function save($type){
		$connect = new Connect();
		$connect = $connect->insert('contacts',array('type' => $type));
		return $connect;
	}
	
	public function update($id,$type){
		$connect = new Connect();
		$connect = $connect->update('contacts',$id,array('type' => $type));
		return $connect;
	}
	
	public function delete($id){
		$connect = new Connect();
		$connect = $connect->delete('contacts',$id);
		return $connect;
	}
}

?>



